<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>XHR解密工具</title>
    <style>
        body {
            width: 350px;
            padding: 20px;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: #1e1e1e;
            color: #d4d4d4;
            margin: 0;
        }

        .header {
            text-align: center;
            margin-bottom: 20px;
        }

        .title {
            color: #569cd6;
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 5px;
            text-shadow: 0 0 10px rgba(86, 156, 214, 0.3);
        }

        .subtitle {
            color: #9cdcfe;
            font-size: 12px;
        }

        .steps {
            background: #252526;
            border: 1px solid #3c3c3c;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 15px;
            font-size: 13px;
            line-height: 1.5;
        }

        .steps div {
            margin-bottom: 8px;
            color: #9cdcfe;
        }

        .steps div:last-child {
            margin-bottom: 0;
        }

        .config-section {
            background: #252526;
            border: 1px solid #3c3c3c;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 15px;
        }

        .config-title {
            color: #569cd6;
            font-size: 14px;
            font-weight: bold;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
        }

        .config-title::before {
            content: '🔧';
            margin-right: 8px;
        }

        .select-wrapper {
            position: relative;
            margin-bottom: 10px;
        }

        .config-select {
            width: 100%;
            padding: 8px 12px;
            background: #2d2d2d;
            border: 1px solid #3c3c3c;
            border-radius: 4px;
            color: #d4d4d4;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .config-select:focus {
            outline: none;
            border-color: #569cd6;
            box-shadow: 0 0 0 2px rgba(86, 156, 214, 0.2);
        }

        .checkbox-group {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
        }

        .config-checkbox {
            margin-right: 8px;
            transform: scale(1.1);
        }

        .checkbox-label {
            color: #d4d4d4;
            font-size: 13px;
            cursor: pointer;
        }

        .description {
            color: #9cdcfe;
            font-size: 11px;
            line-height: 1.3;
            margin-top: 5px;
        }

        .status {
            font-size: 12px;
            color: #6a9955;
            margin-top: 10px;
            line-height: 1.3;
            text-align: center;
            max-width: 320px;
        }

        .notification {
            position: fixed;
            top: 10px;
            right: 10px;
            padding: 8px 12px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: bold;
            z-index: 10000;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
            animation: slideIn 0.3s ease;
        }

        .notification.success {
            background: #4ec9b0;
            color: white;
        }

        .notification.error {
            background: #f44747;
            color: white;
        }

        @keyframes slideIn {
            from {
                transform: translateX(100%);
                opacity: 0;
            }

            to {
                transform: translateX(0);
                opacity: 1;
            }
        }
    </style>
</head>

<body>
    <div class="header">
        <div class="title">🔓 XHR解密工具</div>
        <div class="subtitle">Chrome扩展 - XHR请求解密工具</div>
    </div>

    <div class="steps">
        <div>1. 选择解密方案</div>
        <div>2. 打开开发者工具</div>
        <div>3. 开始监控和解密XHR请求</div>
    </div>

    <div class="config-section">
        <div class="config-title">解密方案选择</div>
        <div class="select-wrapper">
            <select id="decryptMethodSelect" class="config-select">
                <option value="timestamp-traceid">雪花算法 (默认)</option>
                <option value="uuid-based">冒泡算法</option>
                <option value="custom-logic">线性算法</option>
            </select>
        </div>
        <div class="description">选择用于解密XHR请求数据的解密方案</div>
    </div>

    <div class="config-section">
        <div class="config-title">其他选项</div>
        <div class="checkbox-group">
            <input type="checkbox" id="enableAutoDecrypt" class="config-checkbox">
            <label for="enableAutoDecrypt" class="checkbox-label">启用自动解密</label>
        </div>
        <div class="description">自动解密所有捕获的XHR请求，无需手动点击解密按钮</div>
    </div>

    <div id="status" class="status">方案: 雪花算法 | 手动解密</div>

    <div class="config-section">
        <div class="config-title">统计面板</div>
        <button id="openStatsBtn" class="btn" style="width: 100%; margin-top: 10px;">📊 打开统计面板</button>
        <div class="description">查看解密统计信息和性能分析</div>
    </div>

    <script src="popup.js"></script>
</body>

</html>